<script>
const begin = Date.now()
console.log('开始 =', begin);
// setTimeout(() => {
const p = new Promise(function(resolve, reject) {
  console.log(resolve)
  for(let i=0; i<10**9; i++) {}
  console.log('循环结束，耗时：',
    Date.now() - begin
  )
  reject()
})
console.log(p)
// }, 0)
// setTimeout(() => {
//   for(let i=0; i<10**9; i++) {}
//   console.log('异步结束，耗时：',
//     Date.now() - begin
//   )
// }, 0)
console.log('结束 =', Date.now(), '耗时：',
  Date.now() - begin
)
</script>